package cn.bzc.data.process.model.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface TableMapper {
    /**
     * 获取所有表信息
     **/
    @Select("select * from information_schema.TABLES where TABLE_SCHEMA=(select database())")
    List<Map> listTable();
    /**
     * 获取表字段信息
     **/
    @Select("select * from information_schema.COLUMNS where TABLE_SCHEMA = (select database()) and TABLE_NAME=#{tableName}")
    List<Map> listTableColumn(String tableName);
    /**
     * 获取表中数据条数
     **/
    @Select("select count(*) as count from ${tableName}")
    Map listTableValue(String tableName);

}

